<?php

namespace app\admin\model;

use think\Model;


class LitestoreTechQuestion extends Model
{

    

    

    // 表名
    protected $name = 'litestore_tech_question';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'qs_type_text',
        'qs_status_text'
    ];
    

    
    public function getQsTypeList()
    {
        return ['0' => __('Qs_type 0'), '1' => __('Qs_type 1'), '2' => __('Qs_type 2'), '3' => __('Qs_type 3')];
    }

    public function getQsStatusList()
    {
        return ['0' => __('Qs_status 0'), '1' => __('Qs_status 1')];
    }


    public function getQsTypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['qs_type']) ? $data['qs_type'] : '');
        $list = $this->getQsTypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getQsStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['qs_status']) ? $data['qs_status'] : '');
        $list = $this->getQsStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
